<template>
	<view class="container">
		<view class="box-1">
			<view class="user">
				<image :src="$img_path('/mall/5.png')" mode="aspectFill"></image>
				<view class="info">
					<view class="name">
						李四（12345678910）
					</view>
					<view class="pf">
						服务评分：<text>95.0</text>
					</view>
				</view>
			</view>
			<view class="time">
				提交时间：2024-05-24 10:00:00
			</view>
		</view>
		<view class="status">
			<text>申诉类型名称</text>
			<text>未回复</text>
		</view>
		<view class="liyou">
			<view class="title">
				申诉理由
			</view>
			<view class="content-val">
				<view class="text">
					内容内容内容内容内容内容内容内容内容内容内容内容内
					容内容内容内容内容内容内容内容内容内容内容内容内容
					内容内容内容内容内容
				</view>
				<view class="img">
					<image @click="previewImg()" :src="$img_path('/mall/5.png')" mode="aspectFill"></image>
					<image :src="$img_path('/mall/5.png')" mode="aspectFill"></image>
					<image :src="$img_path('/mall/5.png')" mode="aspectFill"></image>
					<image :src="$img_path('/mall/5.png')" mode="aspectFill"></image>
					<image :src="$img_path('/mall/5.png')" mode="aspectFill"></image>
					<image :src="$img_path('/mall/5.png')" mode="aspectFill"></image>
				</view>
			</view>
		</view>
		
		
		<view class="bottom-btn">
			<view class="btn-box">
				<button class="color-h" @click="$refs.djDate.open()">冻结</button>
				<button class="color-h border-left" @click="$refs.confrimBox.open()">解冻</button>
				<button class="color-h border-left" @click="$refs.editFen.open()">调分</button>
				<!-- <button class="color-r" @click="backMsg">回复</button> -->
			</view>
		</view>
		
		
		
		<uni-popup ref="djDate" background-color="#fff" type="bottom" @change="change" customClass="bgF">
			<view class="p-top">
				<view class="left" @click="close">取消</view>
				<view class="title">选择冻结日期</view>
				<view class="right" @click="confirm">确定</view>
			</view>
			<view class="popup-content" :class="{ 'popup-height': type === 'left' || type === 'right' }">
				<picker-view class="picker-view" indicator-style="height: 50px;" :immediate-change="true" mask-style="background:rgba(0,0,0,0)" :value="dateValue" @change="bindChange">
					<view class="center-bg"></view>
					<picker-view-column>
						<view class="item" v-for="(item,i) in dList" :key="i" :style="{color:i==dateValue[0] ? '#333333' : '#999999',fontSize:i==dateValue[0] ? '36rpx' : '32rpx'}">
							{{item.text}}
						</view>
					</picker-view-column>
				</picker-view>
			</view>
		</uni-popup>
		
		<popupBox ref="confrimBox" contentBG="#ffffff">
			<view class="popup-con">
				<view class="title">
					提示
				</view>
				<view class="c-text">
					你确定解冻？
				</view>
			</view>
		</popupBox>
		
		<popupBox ref="editFen" contentBG="#ffffff">
			<view class="popup-con">
				<view class="title">
					调分
				</view>
				<view class="con-check">
					<view class="radio-box">
						<view class="r-i">
							<image v-if="true" :src="$img_path('/pagesMine/14.png')" mode="widthFix"></image>
							<image v-else :src="$img_path('/pagesMine/15.png')" mode="widthFix"></image>
							<text>加分</text>
						</view>
						<view class="r-i">
							<image v-if="false" :src="$img_path('/pagesMine/14.png')" mode="widthFix"></image>
							<image v-else :src="$img_path('/pagesMine/15.png')" mode="widthFix"></image>
							<text>减分</text>
						</view>
					</view>
					
					<view class="inp-box">
						<input type="number" placeholder="请输入" />
					</view>
				</view>
			</view>
		</popupBox>
		
		<view class="black-bg" @click="isBackMsg = false;showEmo=false" v-if="isBackMsg"></view>
		<view class="huifu-msg" :class="isBackMsg?'show' : 'hide'">
			<view class="textarae-box">
				<textarea placeholder="回复" @focus="showEmo = false" v-model="msg"></textarea>
			</view>
			<view class="btn">
				<image @click="showEmo = !showEmo" :src="$img_path('/pagesRegion/12.png')" mode="widthFix"></image>
				<button>发送</button>
			</view>
			
			
			<view class="emoji-box" :class="showEmo?'show':'hide'">
				<emoKeyboard class="pt" :show="true" :data="emojiList" @change="change" @delMsg="delMsg"></emoKeyboard>
			</view>
		</view>
	</view>
</template>

<script>
	import emoKeyboard from '@/components/emoji/emoji.vue'
	import popupBox from '@/components/popup/popup.vue'
	export default {
		components:{
			popupBox,
			emoKeyboard
		},
		data() {
			return {
				dList:[
					{
						text:'6小时',
						value:1
					},{
						text:'12小时',
						value:2
					},{
						text:'1天',
						value:3
					},{
						text:'2天',
						value:4
					},{
						text:'3天',
						value:5
					},
				],
				dateValue:null,
				
				isBackMsg:false,
				msg:'',
				emojiList:[],
				showEmo:false
			};
		},
		onLoad() {
			this.getEmojiData()
		},
		methods:{
			change(){},
			bindChange(val){
				console.log(val,'-')
			},
			close(){
				this.$refs.popup.close()
			},
			confirm(){
				this.close()
				
			},
			previewImg(){
				uni.previewImage({
					urls:[],
					current:0
				})
			},
			backMsg(){
				this.isBackMsg = true
			},
			
			
			change(emoji) {
				this.msg += emoji
			},
			delMsg() { //删除	
				if (!this.msg) return
				const lastTwoChars = this.msg.slice(-2);
				if (this.isEmoji(lastTwoChars)) {
					this.msg = this.msg.substring(0, this.msg.length - 2);
				} else {
					this.msg = this.msg.substring(0, this.msg.length - 1);
				}
			},
			
			getEmojiData() { //表情可以去这里复制https://geekerline.com/emoji/
				this.emojiList = [
					"😀", "😃", "😄", "😁", "😆", "😅", "😂", "😊", "😇", "🙂",
					"🙃", "😉", "😌", "😍", "😘", "😗", "😙", "😚", "😋","😜",
					"🤓", "😎", "😏", "😒", "😞", "😔", "😟", "😕", "🙁", "😣",
					"😖", "😫","😩", "😢", "😭", "😤", "😠", "😡", "😳", "😱",
					"😨", "😰", "😥", "😓", "🤗", "🤔", "😶", "😐", "😑", "😬",
					"🙄", "😯", "😦", "😧", "😮", "😲", "😴", "😪", "😵", "🤐",
					"😷", "🤒", "🤕", "🤑", "😈", "👿", "👹", "👺", "💩", "👻",
					"💀", "☠", "👽", "👾", "🤖", "🎃", "😺", "😸", "😹", "😻",
					"😼", "😽", "🙀", "😿", "😾"
				];
			},
			isEmoji(str) {
				// 匹配表情的正则表达式
				const regExp = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
				return regExp.test(str);
			}
		}
	}
</script>

<style>
	page{
		background-color: #FFFFFF;
	}
</style>
<style lang="scss" scoped>
.container{
	.box-1{
		padding: 30rpx 22rpx 20rpx;
		box-sizing: border-box;
		border-bottom: 20rpx solid #EEEEEE;
		.user{
			display: flex;
			align-items: center;
			image{
				width: 116rpx;
				height: 116rpx;
				border-radius: 50%;
			}
			.info{
				padding-left: 20rpx;
				.name{
					font-weight: bold;
					font-size: 32rpx;
					color: #000000;
					line-height: 44rpx;
				}
				.pf{
					font-weight: 400;
					font-size: 26rpx;
					color: #333333;
					line-height: 36rpx;
					margin-top: 20rpx;
					text-align: left;
					text{
						color: #FFA33A;
					}
				}
			}
		}
		.time{
			font-weight: 400;
			font-size: 28rpx;
			color: #7A7A7A;
			line-height: 40rpx;
			margin-top: 20rpx;
		}
	}
	.status{
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 28rpx 22rpx;
		box-sizing: border-box;
		border-bottom: 20rpx solid #EEEEEE;
		text{
			&:first-child{
				font-weight: bold;
				font-size: 36rpx;
				color: #000000;
				line-height: 50rpx;
			}
			&:last-child{
				font-weight: 400;
				font-size: 32rpx;
				color: #FF4A4A;
				line-height: 44rpx;
			}
		}
	}

	.liyou{
		padding: 40rpx 22rpx;
		box-sizing: border-box;
		border-bottom: 20rpx solid #EEEEEE;
		.title{
			font-weight: bold;
			font-size: 32rpx;
			color: #000000;
			line-height: 44rpx;
		}
		.content-val{
			.text{
				font-weight: 400;
				font-size: 28rpx;
				color: #000000;
				line-height: 40rpx;
				margin-top: 20rpx;
			}
			.img{
				display: flex;
				flex-wrap: wrap;
				image{
					width: 160rpx;
					height: 160rpx;
					border-radius: 20rpx;
					&:not(:nth-child(4n)){
						margin-right: 20rpx;
					}
					margin-top: 20rpx;
				}
			}
		}
	}

	.bottom-btn{
		width: 100%;
		height: calc(constant(safe-area-inset-bottom) + 108rpx);
		height: calc(env(safe-area-inset-bottom) + 108rpx);
		.btn-box{
			display: flex;
			padding-bottom: constant(safe-area-inset-bottom);
			padding-bottom: env(safe-area-inset-bottom);
			position: fixed;
			bottom: 0;
			left: 0;
			right: 0;
			width: 100%;
			button{
				flex: 1;
				height: 88rpx;
				font-weight: 400;
				font-size: 36rpx;
				line-height: 88rpx;
				border-radius: 0;
				&.color-h{
					background: #EEEEEE;
					color: #333333;
				}
				&.color-r{
					background: #E72A2A;
					color: #FFFFFF;
				}
				&.border-left{
					border-left: 2rpx solid #FFFFFF;
				}
			}
		}
	}
}

.black-bg{
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	width: 100vw;
	height: 100vh;
	background-color: rgba(0, 0, 0, 0.5);
	z-index: 4;
}
.huifu-msg{
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 5;
	background-color: #FFFFFF;
	padding: 38rpx 22rpx 0;
	box-sizing: border-box;
	padding-bottom: calc(constant(safe-area-inset-bottom) + 20rpx);
	padding-bottom: calc(env(safe-area-inset-bottom) + 20rpx);
	transition: all .3s;
	&.show{
		transform: translateY(0);
	}
	&.hide{
		transform: translateY(100%);
	}
	.textarae-box{
		width: 100%;
		height: 176rpx;
		background: #EEEEEE;
		border-radius: 20rpx;
		padding: 14rpx 24rpx;
		box-sizing: border-box;
		textarea{
			width: 100%;
			height: 100%;
		}
	}
	.btn{
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin-top: 20rpx;
		&>image{
			width: 48rpx;
			height: 48rpx;
		}
		button{
			width: 162rpx;
			height: 72rpx;
			background: linear-gradient( 87deg, #FFA233 0%, #FB4C4C 100%);
			border-radius: 42rpx;
			font-weight: 400;
			font-size: 32rpx;
			color: #FFFFFF;
			line-height: 72rpx;
		}
	}
	.emoji-box{
		width: 100%;
		padding-top: 20rpx;
		transition: all .4s;
		overflow: hidden;
		box-sizing: border-box;
		.pt{
			margin-top: 20rpx;
		}
		&.show{
			height: 510rpx;
		}
		&.hide{
			height: 0;
		}
	}
}


.popup-con{
	.title{
		text-align: center;
		font-weight: bold;
		font-size: 36rpx;
		color: #000000;
		line-height: 50rpx;
		padding: 28rpx 0 70rpx;
	}
	.c-text{
		font-weight: bold;
		font-size: 36rpx;
		color: #000000;
		line-height: 50rpx;
		padding-bottom: 66rpx;
	}
	.con-check{
		margin-top: -44rpx;
		.radio-box{
			display: flex;
			align-items: center;
			justify-content: space-between;
			width: 340rpx;
			margin: 0 auto;
			.r-i{
				display: flex;
				align-items: center;
				image{
					width: 40rpx;
					height: 40rpx;
				}
				text{
					font-weight: bold;
					font-size: 32rpx;
					color: #000000;
					line-height: 44rpx;
					margin-left: 16rpx;
				}
			}
		}
		.inp-box{
			width: 508rpx;
			height: 100rpx;
			background: #FFFFFF;
			border-radius: 8rpx 8rpx 8rpx 8rpx;
			border: 2rpx solid #B4B4B4;
			margin-top: 34rpx;
			margin-bottom: 54rpx;
			input{
				width: 100%;
				height: 100%;
				padding: 0 20rpx;
				box-sizing: border-box;
			}
		}
	}
}

	.p-top{
		display: flex;
		align-items: flex-end;
		justify-content: space-between;
		padding: 36rpx 28rpx 10rpx;
		box-sizing: border-box;
		.left{
			font-weight: bold;
			font-size: 30rpx;
			color: #333333;
			line-height: 42rpx;
		}
		.title{
			font-weight: bold;
			font-size: 36rpx;
			color: #333333;
			line-height: 50rpx;
		}
		.right{
			font-weight: bold;
			font-size: 30rpx;
			color: #E72A2A;
			line-height: 42rpx;
		}
	}
	
	.popup-content{
		padding: 0 22rpx;
		box-sizing: border-box;
	}
	
	.picker-view {
		width: 100%;
		height: 510rpx;
		margin-top: 20rpx;
		position: relative;
		.center-bg{
			width: 100%;
			height: 102rpx;
			background-color: #F4F4F4;
			position: absolute;
			left: 0;
			top: 50%;
			transform: translateY(-50%);
			z-index: 0;
			border-radius: 16rpx;
		}
	}
	/deep/ .item {
		line-height: 102rpx;
		text-align: center;
		font-family: PingFang SC, PingFang SC;
		font-weight: bold;
		font-size: 36rpx;
		color: #333333;
		font-style: normal;
		text-transform: none;
	}
	.button-b{
		display: flex;
		justify-content: space-between;
		button{
			width: 300rpx;
			height: 82rpx;
			border-radius: 41rpx;
			font-family: PingFang SC, PingFang SC;
			font-weight: bold;
			font-size: 30rpx;
			line-height: 82rpx;
			text-align: center;
			font-style: normal;
			text-transform: none;
			&:first-child{
				background-color: #F5F5F5;
				color: #777777;
			}
			&:last-child{
				background-color: #FD5100;
				color: #FFFFFF;
				margin-left: 24rpx;
			}
		}
	}
</style>
